#pragma once
#include "EnvelopDetector.h"
namespace yzrilyzr_dsp{
	ECLASS(NoiseGate, public DSP){
	private:
	EnvelopDetector envDec;
	public:
	u_normal_01 threshold=0.01;
	NoiseGate();
	NoiseGate(u_normal_01 threshold, u_time_ms attack, u_time_ms hold, u_time_ms release,
			  int limitType);
	u_sample procDsp(u_sample v) override;
	void init(u_sample_rate sampleRate) override;
	void resetMemory() override;
	std::shared_ptr<DSP> cloneDSP() override;
	void cloneParam(DSP * obj1) override;
	yzrilyzr_lang::String toString()const override;
	};
}